package com.mycompany.myapp.web.rest.controller;

import com.mycompany.myapp.service.OrderService;
import com.mycompany.myapp.web.rest.utils.ResultObj;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.ZonedDateTime;

@Api(tags = {"后台管理-报表管理"})
@RestController
@RequestMapping("/api")
public class MReportController {

    @Autowired
    private OrderService orderService;

    @ApiOperation("当日财务")
    @GetMapping("/mreport/today")
    public ResultObj selectAllByToDay() {
        return orderService.selectAllByToDay();
    }


    @ApiOperation("最近一周财务")
    @GetMapping("/mreport/week")
    public ResultObj selectAllByWeek() {
        return orderService.selectAllByWeek();
    }

    @ApiOperation("任意时间范围内")
    @GetMapping("/mreport/anyTime")
    public ResultObj selectAllByAnyTime(@RequestParam(value = "startTime",required = true)String startTime,
                                        @RequestParam(value = "endTime",required = true)String endTime) {
        return orderService.selectAllByAnyTime(startTime,endTime);
    }

}
